package com.zoe.onelink.sentinel.property;

import com.alibaba.cloud.sentinel.datasource.RuleType;
import com.zoe.onelink.sentinel.enumeration.SentinelDatasourceType;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>标题: </p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2022</p>
 * <p>公司: 智业软件股份有限公司</p>
 *
 * @version: 1.0
 * @author: ruansheng
 * @date: 2022-04-18
 */
@Data
@ConfigurationProperties(prefix = OnelinkSentinelProperties.PREFIX)
public class OnelinkSentinelProperties {

    public static final String PREFIX = "onelink.governance.sentinel";

    /**
     * 当默认配置为空时,是否自动创建数据源规则
     */
    private boolean autoCreateDatasource = true;

    /**
     * 需要自动创建的规则列表
     */
    private List<RuleType> rules = new ArrayList<>();

    /**
     * 数据源类型
     */
    private SentinelDatasourceType datasourceType = SentinelDatasourceType.NACOS;


}
